package tr.edu.metu.is.mega.common.dto;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import tr.edu.metu.is.mega.client.resource.MegaConstants;

/**
 * Data structure class for lecture notes.
 * 
 */
public class LectureNoteDTO extends BaseDTO {

    private static final long serialVersionUID = 674434437910615098L;

    public static final String FIELD_DESCRIPTION = "description";

    public static final String FIELD_FILEPATH = "filePath";

    @NotNull
    @Size(max = 100)
    private String description;

    @NotNull
    private String filePath;

    private CourseDTO course;

    public LectureNoteDTO() {
    }

    /**
     * Returns description.
     * 
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * Sets description value.
     * 
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * Returns filePath.
     * 
     * @return the filePath
     */
    public String getFilePath() {
        return filePath;
    }

    /**
     * Returns full filePath.
     * 
     * @return the full filePath
     */
    public String getFullFilePath() {
        return MegaConstants.COURSE_FILES_PATH + course.getCode().hashCode() + "/" + filePath;
    }

    /**
     * Sets filePath value.
     * 
     * @param filePath the filePath to set
     */
    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

    /**
     * Returns course.
     * 
     * @return the course
     */
    public CourseDTO getCourse() {
        return course;
    }

    /**
     * Sets course value.
     * 
     * @param course the course to set
     */
    public void setCourse(CourseDTO course) {
        this.course = course;
    }

}
